export const tableConfig = [
  // el-table列属性可以透传
  {
    prop: "name",
    label: "姓名",
  },
  {
    prop: "number",
    label: "电话",
  },
  {
    prop: "email",
    label: "邮箱",
  },
  {
    prop: "time",
    label: "时间",
  },
  {
    prop: "age",
    label: "年龄",
  },
  {
    prop: "desc",
    label: "排序",
  },
  {
    prop: "action",
    label: "操作",
  },
];

export const formConfig = {
  layout: "horizontal",
  okTxt: "搜索",
  cancelTxt: "重置",
  item: [
    {
      key: "name",
      type: "input",
      label: "姓名",
      size: "small",
      style: { width: "350px" },
    },
    {
      key: "number",
      type: "input",
      label: "电话",
      size: "small",
      style: { width: "350px" },
    },
    {
      key: "email",
      type: "input",
      label: "邮箱",
      style: { width: "350px" },
      size: "small",
    },
    {
      key: "time",
      type: "datetimerange",
      label: "时间",
      size: "small",
      style: { width: "350px" },
    },
  ],
};

export const modalConfig = {
  hasAdd: true,
  hasDelete: true,
  addApi: "/api/add",
  deleteApi: "/api/delete",
  title: "用户",
  formConfig: {
    okTxt: "新增",
    layout: "vertical",
    deleteApi: "/api/delete",
    item: [
      {
        key: "name",
        type: "input",
        label: "姓名",
        size: "small",
        require: true,
      },
      {
        key: "number",
        type: "input",
        label: "电话",
        size: "small",
        require: true,
      },
      {
        key: "email",
        type: "input",
        label: "邮箱",
        size: "small",
        require: true,
      },
      {
        key: "time",
        type: "datetime",
        label: "创建时间",
        size: "small",
        require: true,
      },
    ],
  },
};
